import unittest
#from zope.testing import doctest

from Products.Five import zcml
from Products.Five import fiveconfigure

from Testing import ZopeTestCase as ztc

from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import onsetup

@onsetup
def setup_product():
    """
       Set up the package and its dependencies.
    """
    fiveconfigure.debug_mode = True
    import collective.transform.pdf2swf
    zcml.load_config('configure.zcml', collective.transform.pdf2swf)

    fiveconfigure.debug_mode = False

setup_product()
ptc.setupPloneSite(products=['collective.transform.pdf2swf'])

class Pdf2SwfTestCase(ptc.PloneTestCase):
    pass

def test_suite():
    return unittest.TestSuite([

        # Integration tests that use PloneTestCase
        ztc.ZopeDocFileSuite(
           'README.txt', package='collective.transform.pdf2swf',
           test_class=Pdf2SwfTestCase),
        ])

if __name__ == '__main__':
    unittest.main(defaultTest='test_suite')
